home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / tutorial / adatu311.zip / UNIX.ADA < prev    next >
Text File  |  1996-01-10  |  2KB  |  50 lines

  1. -- UNIX.ADA   Ver. 3.11   10-JAN-1996   Copyright 1988-1996 John J. Herro
  2. --
  3. -- SOFTWARE INNOVATIONS TECHNOLOGY          http://members.aol.com/AdaTutor
  4. -- 1083 MANDARIN DR NE                      ftp://members.aol.com/AdaTutor
  5. -- PALM BAY FL 32905-4706
  6. --                                          johnherro@aol.com
  7. -- (407) 951-0233                           john.herro%374-38-2@satlink.oau.org
  8. --
  9. -- Compile this before compiling ADA_TUTR.ADA on a UNIX based system.  You must
  10. -- also compile ONECHAR.C or ALTCHAR.C with a C compiler before linking.  See
  11. -- the first page of ADA_TUTR.ADA for more details.
  12. --
  13. with Text_IO;
  14. package Custom_IO is
  15.    type Color is (Black, Red, Green, Yellow, Blue, Magenta, Cyan, White);
  16.    Foregrnd_Color   : Color := White;                 -- Default values in case
  17.    Backgrnd_Color   : Color := Black;                 -- ADA-TUTR finds no User
  18.    Border_Color     : Color := Black;                 -- File.
  19.    Fore_Color_Digit : Character := Character'Val(Color'Pos(Foregrnd_Color)+48);
  20.    Back_Color_Digit : Character := Character'Val(Color'Pos(Backgrnd_Color)+48);
  21.    Normal_Colors    : String(1 .. 10) := ASCII.ESC & "[0;3" &
  22.                               Fore_Color_Digit & ";4" & Back_Color_Digit & "m";
  23.    Clear_Scrn       : constant String := ASCII.ESC & "[H" & ASCII.ESC & "[2J";
  24.  
  25.    procedure Set_Border_Color (To   : in  Color);
  26.    procedure Get              (Char : out Character);
  27.    procedure Put              (Char : in  Character) renames Text_IO.Put;
  28.    procedure Put              (Str  : in  String)    renames Text_IO.Put;
  29.    procedure Put_Line         (Str  : in  String)    renames Text_IO.Put_Line;
  30.    procedure Get_Line         (Str  : out String;
  31.                                Last : out Natural)   renames Text_IO.Get_Line;
  32.    procedure New_Line      (Spacing : in  Text_IO.Count := 1)
  33.                                                      renames Text_IO.New_Line;
  34. end Custom_IO;
  35.  
  36. package body Custom_IO is
  37.    procedure Set_Border_Color(To : in Color) is
  38.       -- Dummy procedure for computers other than PCs.
  39.    begin
  40.       null;
  41.    end Set_Border_Color;
  42.  
  43.    procedure Get(Char : out Character) is
  44.       function Onechar return Character;
  45.       pragma Interface (C, Onechar);            -- Pragma Interface is used for
  46.    begin                                        -- compatibility with Ada 83.
  47.       Char := Onechar;
  48.    end Get;
  49. end Custom_IO;
  50.